# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ArtifactRegistry.V1.Model.CleanupPolicyCondition do
  @moduledoc """
  CleanupPolicyCondition is a set of conditions attached to a CleanupPolicy. If multiple entries are set, all must be satisfied for the condition to be satisfied.

  ## Attributes

  *   `newerThan` (*type:* `String.t`, *default:* `nil`) - Match versions newer than a duration.
  *   `olderThan` (*type:* `String.t`, *default:* `nil`) - Match versions older than a duration.
  *   `packageNamePrefixes` (*type:* `list(String.t)`, *default:* `nil`) - Match versions by package prefix. Applied on any prefix match.
  *   `tagPrefixes` (*type:* `list(String.t)`, *default:* `nil`) - Match versions by tag prefix. Applied on any prefix match.
  *   `tagState` (*type:* `String.t`, *default:* `nil`) - Match versions by tag status.
  *   `versionNamePrefixes` (*type:* `list(String.t)`, *default:* `nil`) - Match versions by version name prefix. Applied on any prefix match.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :newerThan => String.t() | nil,
          :olderThan => String.t() | nil,
          :packageNamePrefixes => list(String.t()) | nil,
          :tagPrefixes => list(String.t()) | nil,
          :tagState => String.t() | nil,
          :versionNamePrefixes => list(String.t()) | nil
        }

  field(:newerThan)
  field(:olderThan)
  field(:packageNamePrefixes, type: :list)
  field(:tagPrefixes, type: :list)
  field(:tagState)
  field(:versionNamePrefixes, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.ArtifactRegistry.V1.Model.CleanupPolicyCondition do
  def decode(value, options) do
    GoogleApi.ArtifactRegistry.V1.Model.CleanupPolicyCondition.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ArtifactRegistry.V1.Model.CleanupPolicyCondition do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
